<?php

	class Account_controller extends CI_Controller{

		function __construct(){
			parent::__construct();
			$this->data['logged_email'] = $this->session->userdata('logged_email');
		}

		function index(){
			  $section = "account";
        
                    // Use for breadcrumb
                    $cfer = new Cfer(array(
                        lang('txt_dashboard') => base_url('dashboard'),
                        lang('txt_account') => base_url($section))
                    );

                    $filter = array();
                    $filter['name'] = $this->input->post('name') ? $this->input->post('name') : "";
                    //$filter['group'] = $this->input->post('group');
                    $account = new Account();
                    $account->addSelect();
                    $account->addSelect("id, code, name, id_user, is_company_acc, balance, actual_balance");
                    
                   
                    $account->orderBy("name ASC");
                    $account->find();

                    $this->data['account'] = $account;
                    $this->data['filter'] = $filter;

                    $array_menus = array();
                    $filter = array();
                    $filter['parent_id'] = 0;
                    $filter['type'] = 1;
                    //Menu::getMenuTree($array_menus, $filter);

                    $this->data['cfer'] = $cfer;
                    //$this->data['array_menus'] = $array_menus;
                    $this->data['section'] = $section;

                    $this->load->view('main', $this->data);
                    
		}
		
                
		// You can place some more methods code here

	}
